package com.jysz.certificate.persistence.enums;


/**
 * 附件类型
 * @author xuxiaolong
 */
public enum AttachmentType {
	RELEASE("释放单附件", 0,"release/"),CHECKSTOCK("盘库单附件", 1,"checkstock/"),RENEW("合格证换证附件", 2, "renew/"), THEINTERNET("二网申请单附件", 3,"theinternet/"), OTHER("其他附件", 4,"other/");   
	   
    //名称
    private String name;
    //索引
    private int index;   
    //路径在config.properties中的key
    private String path;   
    
    private AttachmentType(String name, int index,String path) {   
        this.name = name;   
        this.index = index;   
        this.path=path;
    }   
    
    //根据索引获得名称
    public static String getName(int index) {   
        for (AttachmentType a : AttachmentType.values()) {   
            if (a.getIndex() == index) {   
                return a.name;   
            }   
        }   
        return null;   
    }
    
    //根据索引获得path
    public static String getPath(int index) {   
    	for (AttachmentType a : AttachmentType.values()) {   
    		if (a.getIndex() == index) {   
    			return a.path;   
    		}   
    	}   
    	return null;   
    }
    
    public String getName() {   
        return name;   
    }   
    public void setName(String name) {   
        this.name = name;   
    }   
    public int getIndex() {   
        return index;   
    }   
    public void setIndex(int index) {   
        this.index = index;   
    }

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}   


}
